package LuMin.file.Write;

import java.io.*;

/**
 * @author lumin
 * @date 2022/05/09 20:22
 **/
public class WriteFile1 {
    public static void main(String[] args) throws IOException{
        try(OutputStream os = new FileOutputStream("world.txt")){
            try(Writer writer = new OutputStreamWriter(os,"UTF-8")){
                try(PrintWriter printWriter = new PrintWriter(writer)){

                    printWriter.println("你好，世界");
                    printWriter.print("宝鸡");
                    printWriter.printf("%s %d","最美丽",123);


                }
            }
        }
    }
}